package com.biaobiaoqi.scoreanalysis.administrator.action;

import java.util.List;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.biaobiaoqi.scoreanalysis.hibernate.bean.Examination;
import com.biaobiaoqi.scoreanalysis.service.IExaminationService;
import com.opensymphony.xwork2.ActionSupport;

public class ListExam extends ActionSupport {
	private static final long serialVersionUID = 5922603379078692016L;
	private static final Log log = LogFactory.getLog(ListExam.class);
	private int currentPage = 0;
	private List<Examination> list;
	@Resource
	private IExaminationService examinationService;

	public String execute() {
		try {
			list = examinationService.ListAllExamination(currentPage * 9, 9);
			return SUCCESS;
		} catch (Exception e) {
			log.error("list exam failed.", e);
			return ERROR;
		}
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public List<Examination> getList() {
		return list;
	}

	public void setList(List<Examination> list) {
		this.list = list;
	}

	public IExaminationService getExaminationService() {
		return examinationService;
	}

	public void setExaminationService(IExaminationService examinationService) {
		this.examinationService = examinationService;
	}
}
